﻿// //------------------------------------------------------------------------------
// // <copyright file="" company="Dascoba Development">
// //  Copyright © Dascoba Development 2010
// // </copyright>
// //------------------------------------------------------------------------------
namespace Dascoba.Umb.FileManager.Actions
{
    using Dascoba.Umb.FileManager.Support;

    using umbraco;
    using umbraco.interfaces;

    public class ActionExtractArchive : IAction
    {
        /// <summary>
        ///   Initializes a new instance of the <see cref = "ActionExtractArchive" /> class.
        /// </summary>
        private ActionExtractArchive()
        {
        }

        /// <summary>
        ///   Gets the instance.
        /// </summary>
        /// <value>The instance.</value>
        public static ActionExtractArchive Instance
        {
            get
            {
                // return singleton
                return new ActionExtractArchive();
            }
        }

        #region Implementation of IAction

        /// <summary>
        ///   Gets the letter.
        /// </summary>
        /// <value>The letter.</value>
        public char Letter
        {
            get
            {
                // U+00C6: Latin Capital Letter Ae - Alt+0198
                return 'Æ';
            }
        }

        /// <summary>
        ///   Gets a value indicating whether [show in notifier].
        /// </summary>
        /// <value><c>true</c> if [show in notifier]; otherwise, <c>false</c>.</value>
        public bool ShowInNotifier
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        ///   Gets a value indicating whether this instance can be permission assigned.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance can be permission assigned; otherwise, <c>false</c>.
        /// </value>
        public bool CanBePermissionAssigned
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        ///   Gets the icon.
        /// </summary>
        /// <value>The icon.</value>
        public string Icon
        {
            get
            {
                return string.Format("/../../{0}/images/extractArchive.png", Constants.FileManagerFolderName);
            }
        }

        /// <summary>
        ///   Gets the alias.
        /// </summary>
        /// <value>The alias.</value>
        public string Alias
        {
            get
            {
                return "extractArchive";
            }
        }

        /// <summary>
        ///   Gets the name of the js function.
        /// </summary>
        /// <value>The name of the js function.</value>
        public string JsFunctionName
        {
            get
            {
                return "parent.ExtractArchive('" + ui.Text("actions", this.Alias) + "')";
            }
        }

        /// <summary>
        ///   Gets the js source.
        /// </summary>
        /// <value>The js source.</value>
        public string JsSource
        {
            get
            {
                return string.Format("{0}/js/extractArchive.js", Constants.FileManagerGlobalUrl);
            }
        }

        #endregion
    }
}